package Text_28;

public class Code {

	public static void main(String[] args) {
		// 用递归方法求1-100的和
				System.out.println(getSum(100));
				// 用递归方法求5的阶乘
				System.out.println(getFactorial(5));

			}
			public static int getSum(int number) {
				if(number==1) {
					return 1;
				}
				return number+(getSum(number-1));
			}
			public static int getFactorial(int number) {
				if(number ==1) {
					return 1;
				}
				return number*(getFactorial(number-1));

	}

}
